This month features a big pile of new and revised Sample Code and Snippets, thanks to Michelle Wyner, the DTS Sample Code Warrior. If you'd like to provide feedback about sample code, fill out the Sample Code Survey at <http://reg.devworld.apple.com/samplesurvey.qry>, or drop Michelle a line at mwyner@apple.com.
In addition to updates to several of the Language Kits, here are this month's new and revised packages.
ADB Key Spy 1.0.1b3: This package provides something of a replacement for GetKeys by maintaining a key map reflecting the state of each keyboard attached to the Mac via ADB. It contains code illustrating the following techniques:
• building a system extension
• using the ADB API
• "patching" ADB service routines
• building, installing, and using a driver
• mapping physical key codes to virtual key codes
AsyncDriverSample 1.0b4: This sample shows how to write a fully asynchronous block device driver for the traditional Mac OS. The sample tries to implement the simplest possible device driver and therefore doesn’t talk to any real hardware; instead, it mounts disk images over the network.
CFM-68K SDK: CFM-68K is a runtime architecture for 68K-based Macintosh applications and shared libraries. This architecture is modeled after the Power Macintosh runtime architecture and uses the CFM (Code Fragment Manager) to provide shared library support for 68K Macintoshes. CFM-68K runtime applications and shared libraries can coexist and run simultaneously with classic 68K runtime applications.
Version 4.0 of the CFM-68K Runtime Enabler fixes the problem described in Technote #1084 and updates the interfaces required for pre-emptively threaded applications. The SDK includes documentation describing the changes.
This package includes:
• CFM-68K 4.0, Code Fragment Manager for 680x0 Macintoshes
• ObjectSupportLib, version 1.2
• Updated Apple Thread Manager, now included in the CFM-68K Runtime Enabler.
DumpARPCache: A tiny sample that shows how to view the Open Transport ARP cache.
Folder Watching: These applications demonstrate how to write a background task which uses Apple events to pass on task related information to another application.
• How to write a Faceless Background Application that performs a task.
• Sending and receiving application specific Apple events.
• How to receive AppleScript subroutine Apple events.
• Use of the Notification Manager to notify users using alerts, flashing menu bar icon and sound.
• PBCatSearch() of files between modification dates.
• How to write a script application that runs in idle time.
JPEG Sample: This sample demonstrates how to compress and decompress JPEG images with QuickTime. We use the FCompressImage function but the CompressImage counterpart function could also be used. Although this sample strictly demonstrates JPEG compression/decompression you could use this as a framework for other types of compression (except for the decoding of the JPEG header).
Mac OS Runtime for Java 1.0.1b1c2: Mac OS Runtime for Java (MRJ) is Apple’s implementation of the Java runtime environment from Sun Microsystems, Inc. With MRJ, Mac OS applications can use Java applets and applications.
MRJ 1.0.1 implements version 1.0.2 of Sun’s Java. MRJ 1.0.1 includes Apple Applet Runner, a standalone application that runs Java applets, and Apple Applet Viewer, an OpenDoc viewer you use to put Java applets into OpenDoc documents.
MRJ 1.0.1 works on computers with 68030 or 68040 microprocessors or PowerPC microprocessors.You also need System 7.5 or later, a minimum of 8 MB of RAM (16 MB is strongly recommended) and at least 7 MB of free disk space.
This software is being made available to Apple Developers only and is not for public distribution. We are finishing work on MRJ 1.0.1 and the Software Development Kit (SDK) and expect to post them to <http://applejava.apple.com/> by the end of March 1997. See the document "About this Pre-Release of MRJ" for details.
MacCalendar 1.1b1: MacCalendar is a control strip module that displays a calendar when you click on it in the control strip. The calendar display is configured using a separate application, MacCalendar Setup.
MP Threaded Sort: An application showing off the Thread Manager and MP (sorts pictures).
Features:
• Live window dragging
• Continues to run when mouse button is down
• Continues to run even when you're in Macsbug
ProcDoggie 2.1b1: ProcDoggie is a full blown application that demonstrates a variety of Process Manager-related techniques, including:
1. Getting a list of running processes
2. Getting information about a running process
3. Launching a processes, with and without opening documents
RAMDisk 1.4d5: This sample demonstrates how to write a simple Mac OS block device driver, in this case a RAM disk. It also demonstrates how to bundle a system extension (INIT), driver (DRVR) and control panel (cdev) in one file, to achieve maximum functionality while minimising the number of items in the System Folder.
Rhapsody/OpenStep Documentation: OpenStep documentation applies to Rhapsody! That means you can develop OpenStep applications today and use the same source base for
Rhapsody later.
Discovering OPENSTEP: A Developer Tutorial
Introduces programmers to NeXT's OPENSTEP 4.0 Developer product by guiding them through the creation of three applications of increasing complexity. The tutorials demonstrate and explain programming techniques, Objective-C fundamentals, common APIs, and usage of the development tools. Along the way they present summaries of important concepts and paradigms. The book also includes a chapter directing readers to programming resources, further information, and services such as training and support. An appendix offers a concise discussion of object-oriented programming.
Object-Oriented Programming and the Objective-C Language
An introduction to the principles of object-oriented programming in NEXTSTEP and the official description of the Objective-C language. Objective-C is very easy to learn and use, since it adds very little syntax to the C programming language. Its dynamic nature allows you to accomplish things not possible in most other object-oriented languages. For any NEXTSTEP programmer.
Appkit Reference
The complete reference for OpenStep Application kit classes and protocols. The Appkit provides everything the user sees and touches: windows, buttons, formatted text, etc.
Foundation Reference
The complete reference for OpenStep Foundation classes and protocols. Foundation is the heart of any OpenStep application, providing memory management and crucial classes such as NSArray, NSString, and NSThread.
Topics in OPENSTEP Programming
Detailed discussions of the concepts behind the Foundation Kit, the architecture of the OPENSTEP Text System, and the unique Services functionality that allows applications to easily share functionality.
Set Folder Windows: This little AppleScript droplet is used to setup drive and folder windows in preperation for burning a CD. It requires the scriptable Finder from System 7.5 or later. It seems to be more reliable than SWAt at setting things up right, since it uses the Finder rather than directly manipulating desktop information.
TradDriverLoaderLib 1.0b4: The TradDriverLoaderLib provides a bunch of routines helpful for installing traditional Mac OS device drivers (DRVRs). It mimicks the API of the PCI “DriverLoaderLib” as much as possible, which makes the TradDriverLoaderLib easier to use in an environment supporting both PCI native drivers (ndrv) and traditional Mac OS drivers (DRVR).